package com.example.demo.repository;

import com.example.demo.entity.Order;
import org.springframework.data.domain.Example;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by shidong.wu on 2018/1/27.
 */
public interface OrderRepository extends JpaRepository<Order,Long> {

    @Query("SELECT o FROM Order o ")
    List<Order> findAllOrder();

    @Query(value = "SELECT * FROM t_order o where o.order_id = ?1 and o.user_id = ?2",nativeQuery = true)
    Order findOne1(Long orderid,Long user_id);
}
